;;; init-custom.el -*- lexical-binding: t; -*-

(defgroup canary nil
  "Canary emacs customizations"
  :group 'convenience)

(defcustom canary\logo (expand-file-name "logo.png" user-emacs-directory)
  "Set Canary logo. nil for official logo."
  :type 'string
  :group 'canary)

(defcustom canary\user-name "Winkey Wong"
  "Set user name."
  :type 'string
  :group 'canary)

(defcustom canary\mail-address "winkeyme@163.com"
  "Set user email address."
  :type 'string
  :group 'canary)

(defcustom canary\theme 'dark
  "Set color theme."
  :type '(choice
          (const :tag "Dark theme" dark)
          (const :tag "Light theme" light)
          (const :tag "City lights theme" citylights)
          (const :tag "Solarized light theme" solarlight)
          (const :tag "Tao Yang theme" yang)
          (const :tag "Tao Yin theme" yin))
  :group 'canary)

(defcustom canary\frame-maximized-at-startup t
  "Maximize the frame at startup."
  :type 'boolean
  :group 'canary)

(defcustom canary\frame-fullscreen-at-startup nil
  "Make the frame fullscreen at startup."
  :type 'boolean
  :group 'canary)

(defcustom canary\frame-fullscreen-use-native nil
  "Use native fullscreen.

Use to disable fullscreen animations in macOS."
  :type 'boolean
  :group 'canary)

(defcustom canary\global-line-numbers t
  "Display line numebrs globally."
  :type 'boolean
  :group 'canary)

(defcustom canary\use-dashboard t
  "Use dashboard at startup or not.

If Non-nil, use dashboard, otherwise will restore previous session."
  :type 'boolean
  :group 'canary)

(defcustom canary\debug-mode t
  "Debug on error or not."
  :type 'boolean
  :group 'canary)


;; Load `custom-file'
;; If it doesn't exist, copy from the template, then load it.
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))

(let* ((template-dir (expand-file-name "template" canary-lisp-dir))
       (custom-template-file
        (expand-file-name "custom-template.el" template-dir)))
  (if (and (file-exists-p custom-template-file)
           (not (file-exists-p custom-file)))
      (copy-file custom-template-file custom-file)))

(if (file-exists-p custom-file)
    (load custom-file))

(provide 'init-custom)
